/**
 * @filename FreemarkerInterceptor.java
 */
package com.liupf.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.core.ActionInvocation;
import com.jfinal.core.Controller;
import com.liupf.extend.freemarker.HttpInclude;

import freemarker.ext.servlet.IncludePage;

/**
 * @description 
 * @author shevliu
 * @email shevliu@gmail.com
 * Aug 2, 2012 9:33:50 PM
 */
public class FreemarkerInterceptor  implements Interceptor{

	public void intercept(ActionInvocation ai) {
		Controller c = ai.getController() ;
		c.setAttr("httpInclude", new HttpInclude(c.getRequest() , c.getResponse()));
		c.setAttr("include_page", new IncludePage(c.getRequest() , c.getResponse()));
		ai.invoke();
	}
}
